package com.snopy.jdbc;


import java.sql.*;
import java.util.HashMap;
import java.util.Map;

/**
 * @author snopy
 * @description:
 * @classname Test
 * @date 2020/10/20 15:04
 * @email 77912204@qq.com
 */
public class Test {
    public static void main(String[] args) {


        getConnec();
    }
    public static void getConnec(){
        Connection connection = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.5.11:1521:orcl","DFBC2","DFBC2039");
            PreparedStatement preparedStatement = connection.prepareStatement("select * from patient_200002_200003");
            ResultSet resultSet = preparedStatement.executeQuery();
            System.out.println(resultSet.next());
            while (true){
                Thread.sleep(1000);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }/*finally {
            if (connection!=null){
                try {
                    connection.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }*/ catch (InterruptedException e) {
            e.printStackTrace();
        }
    }




}
